<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>取反</title>
</head>

<body>
  <div id="box">
    {{text}}
    <br>
    <button @click="fanzhuan">点击反转</button>
  </div>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.js"></script>
  <script>
    new Vue({
      el: '#box',
      data: {
        text: 'Hello,World',
      },
      methods: {
        fanzhuan() {
          
          let str = this.text.split('')
          let str1 = str.reverse().join('')
          this.text = str1
        }

      }
    })

  </script>
</body>

</html>